package com.atguigu.gmall.user.controller;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.user.model.UserAddress;
import com.atguigu.gmall.user.service.UserAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author: atguigu
 * @create: 2023-01-12 09:27
 */
@RestController
@RequestMapping("/api/user/inner")
public class UserApiContrller {


    @Autowired
    private UserAddressService userAddressService;


    /**
     * 根据用户ID查询用户收件地址薄列表
     * @param userId
     * @return
     */
    @GetMapping("/findUserAddressListByUserId/{userId}")
    public List<UserAddress> findUserAddressListByUserId(@PathVariable("userId") Long userId){
        return userAddressService.findUserAddressListByUserId(userId);
    }
}
